home *** CD-ROM | disk | FTP | other *** search
- /* Small Systems Guild */
- /* PO box 2751 */
- /* 3105 Sunnywood */
- /* Ann Arbor, Michigan 48103 */
- /* (313) 996-4238 */
-
- /* copyright © 1987 Small Systems Guild */
-
- /* source code compilable using */
- /* Lightspeed C compiler 2.01 */
-
- #include "objectMgr.h"
-
- Handle msg(sel,arg)
- USHORT sel;
- Handle arg;
- {
- USHORT result;
-
- result = (USHORT)class_any_object(arg);
- return(_msg(result,sel,arg));
- }
-
- Handle _msg(obj,sel,arg)
- USHORT obj;
- USHORT sel;
- Handle arg;
- {
- USHORT result;
-
- switch (obj) {
- case UNKNOWN:
- result = (USHORT)class_any_object(arg);
- if (result == UNKNOWN)
- return(NULL);
- else
- return(_msg(result,sel,arg));
- break;
- case OBJECT:
- return(Object(sel,arg));
- break;
- case WINDOW:
- return(Window(sel,arg));
- break;
- default:
- return(NULL);
- break;
- }
- }
-
- Handle class_any_object(argHndl)
- Handle argHndl;
- {
- Handle objHndl;
- USHORT objClass;
-
- if (!ValidPointer((Ptr)argHndl))
- return(NULL);
-
- objHndl = ((msgArgs *)argHndl)->objHndl;
- if (ValidHandle(objHndl)) {
- if (!((**((object **)objHndl)).sync == OBJ_SYNC)) {
- objHndl = argHndl;
- if (!((**((object **)objHndl)).sync == OBJ_SYNC))
- return(NULL);
- }
- }
- else {
- objHndl = argHndl;
- if (!((**((object **)objHndl)).sync == OBJ_SYNC))
- return(NULL);
- }
-
- objClass = ((**((object **)objHndl)).isa);
- if (objClass <= 0)
- return(NULL);
-
- return((Handle)objClass);
- }
-